Skip to content

ci(workflows): v1.2.0 — coolify-deploy runs in the caller's environment; setup can skip the pnpm cache [FACT-1910] - #4

Merged
practical-bot merged 1 commit into
mainfrom
ci/fact-1910-deploy-environment
Nov 17, 2026
Merged

practical-bot merged 1 commit into
mainfrom
ci/fact-1910-deploy-environment

Conversation

@jcotillo

@jcotillo jcotillo commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Release v1.2.0 of the shared workflows, for FACT-1910 (factory and frontdesk deploy through coolify-deploy.yml with Infisical OIDC). The outcome spans three repositories, so it is three PRs. A PR here cannot change the callers, and the callers cannot pin a tag that does not exist yet:

  1. this PR — the shared release (v1.2.0)
  2. practical-works-acropolis/practical-works-factory#1266 — auto-agent and brain-door call coolify-deploy.yml@v1.2.0 over OIDC. It leaves no Coolify repository secret referenced and no private copy of the webhook or the wait. The factory's live proof stays around the shared job.
  3. PracticalWorks/frontdesk#565 — frontdesk's deploy calls it in frontdesk-prod, its env sync logs in over OIDC, and cache: "false" is set on its setup calls.

Each caller pins @v1.2.0 in one line per call. A later release reaches both with the same one-line bump. Both callers carry a ## Before merge item for the tag below.

What changes

  • coolify-deploy.yml takes environment and deployment. The factory and frontdesk Infisical identities trust a subject that ends in :environment:<name>. A token carries that segment only when the job that requests it runs in the environment, and a caller job that uses: a workflow cannot set environment:. So the deploy job now sets environment: { name: inputs.environment, deployment: inputs.deployment }. An empty name means no environment, which is today's behaviour. deployment: false stops GitHub writing its own Deployment record for the job. The factory needs that because it writes its own records in auto-agent / brain-door and reads the newest successful one as "what is live".
  • The setup action takes cache (default true). With false, actions/setup-node gets no cache: pnpm. Frontdesk turned the cache off on purpose in FACT-1931 (about 40 s per run, and its runner pool keeps the store).
  • The Infisical action is pinned by commit (d2e351f… = v1.0.18). The job.workflow_sha fallbacks in coolify-deploy.yml and pr-guard.yml move to v1.2.0, as the README says each release must. The README documents the new inputs and why environment exists.
  • scripts/workflows.test.mjs pins the new inputs and the commit pin. It also checks that every fallback ref equals the newest tag in the README.

Verification

  • node --test scripts/*.test.mjs: 27 pass, 0 fail. I checked that the new test can fail: rewriting the deploy job's environment: made it fail 1 of 4.
  • An empty environment and the sub claim, tested on GitHub. An earlier head of this PR (d912a38, f6dd8d9, since squashed away) had a temporary probe workflow with exactly this environment: { name, deployment } block. Run 44105951043 and the run after it showed:
    • with environment empty, the job ran with no environment: sub=repo:PracticalWorks@259778040/.github@1318607589:pull_request
    • with environment: fact-1910-probe and deployment: false, the job ran and sub=repo:PracticalWorks@259778040/.github@1318607589:environment:fact-1910-probe. The caller repo plus the environment is the shape the factory and frontdesk identities bind.
    • GET /repos/PracticalWorks/.github/deployments returned 0 afterwards, so deployment: false wrote no Deployment record. I then deleted the probe environment.
  • YAML parses. actionlint reports only the existing job.workflow_sha / job.workflow_repository unknown-property warnings, which come from its older schema.

After merge

  • Tag the merge commit: gh api repos/PracticalWorks/.github/git/refs -f ref=refs/tags/v1.2.0 -f sha=$(gh pr view 4 -R PracticalWorks/.github --json mergeCommit --jq .mergeCommit.oid). v1 and v1.1.0 are not moved. The two caller PRs above list this tag as their ## Before merge precondition.

Not in this outcome

The card's FACT-1052 criterion was folded in on 2026-11-16: workflow_dispatch on every factory deploy workflow, proven with gh workflow run. It lives entirely in the factory's own workflows, not in this repository. It is not part of these three PRs, and I flagged it on the card for a decision: a follow-up PR, or split back out.

Refs: FACT-1910

🤖 Generated with Claude Code

@jcotillo jcotillo added the merge:queued Hand this PR to the factory merge queue label Nov 17, 2026
…nt; setup can skip the pnpm cache [FACT-1910]

An Infisical OIDC identity that trusts `...:environment:<name>` only matches
a token requested by a job running in that environment, and a caller job
that `uses:` this workflow cannot set `environment:`. coolify-deploy.yml
takes `environment` (empty = none) and `deployment` (default true; false
for a caller that writes its own Deployment records) and runs its deploy
job there.

The setup action takes `cache` (default true) so a caller whose runners keep
the pnpm store can skip the save and restore. The Infisical action is pinned
by commit; the script fallback refs move to v1.2.0. A test pins all three.

Refs: FACT-1910

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jcotillo
jcotillo force-pushed the ci/fact-1910-deploy-environment branch from f6dd8d9 to e823632 Compare November 17, 2026 14:45
@jcotillo
jcotillo marked this pull request as ready for review November 17, 2026 14:45
@jcotillo jcotillo closed this Nov 17, 2026
@jcotillo jcotillo reopened this Nov 17, 2026

@practical-bot practical-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

I reviewed the current card, which is newer than any prior review context: it still requires the factory and frontdesk deploy callers, every factory deploy workflow's workflow_dispatch path, and the live verification steps. This PR correctly implements the shared-workflow portion: environment.name and deployment are valid job-environment settings, the setup action's cache switch is explicit and defaults on, the Infisical action is commit-pinned, and both fallback refs are advanced to v1.2.0. The 27-test ledger claim passes on this head, and the intentional mutation also fails as claimed.

Claim ledger

  • “node --test scripts/*.test.mjs: 27 pass, 0 fail.” PASS — node --test scripts/*.test.mjs → 27 tests, 27 pass, 0 fail.
  • “I checked that the new test can fail: rewriting the deploy job's environment: made it fail 1 of 4.” PASS — mutation command changed name: ${{ inputs.environment }} to name: broken; the test run reported 1..4, pass 3, fail 1.
  • “An empty environment ... showed ... no environment” and “with environment: fact-1910-probe ... sub=...:environment:fact-1910-probe.” UNVERIFIED — the cited run 44105951043 is on old commit d912a381, and its job summary is available, but the claim depends on the deleted probe's log/claims rather than this head's changed files.
  • “GET /repos/PracticalWorks/.github/deployments returned 0 afterwards.” PASS — gh api repos/PracticalWorks/.github/deployments --jq 'length' → 0.
  • “YAML parses. actionlint reports only ... warnings.” UNVERIFIED — actionlint is not installed in this review workspace; the attempted command could not run. This is an environment limitation, not a PR finding.
  • “The README documents the new inputs and why environment exists.” PASS — README includes environment, deployment, examples, and the environment/OIDC explanation.

Findings

  1. The PR does not meet the current FACT-1910 card's caller-workflow scope. The card requires “practical-works-factory's deploy workflows and frontdesk's Coolify deploy call it” and requires every factory deploy workflow to accept workflow_dispatch and be proven with gh workflow run. This diff is only in PracticalWorks/.github (the five changed files are .github/actions/setup/action.yml, .github/workflows/coolify-deploy.yml, .github/workflows/pr-guard.yml, README.md, and scripts/workflows.test.mjs), so it cannot satisfy those criteria or the card's Done-when for both repositories. Either include the caller changes in this outcome/PR or have the PM re-scope FACT-1910 and file/release the caller work as a separately linked outcome before approval. This is judged against the newer card scope, not inferred from the PR title.

  2. The PR body says “After merge, v1.2.0 is tagged on the merge commit,” but the tag is required for the caller workflows' one-line pin bump and is not produced by this diff. If that tag creation is a required precondition for the caller changes in this same outcome, add it under ## Before merge as an unchecked checklist item with the exact tag/ref operation; otherwise document the caller/tag work as the separate follow-up outcome. (No ## Before merge section currently exists.)

Verification owed after merge

NEEDS VERIFICATION: v1.2.0 is tagged on the merge commit and the latest practical-works-factory and PracticalWorks/frontdesk deploy runs source coolify-deploy.yml from PracticalWorks/.github at that tag and are green.
NEEDS VERIFICATION: gh workflow run is accepted and completes for auto-agent, brain-door, bridge, and plane-bridge, and the hand-run restarts the service with the newly added Infisical value, without launchctl or SSH.
NEEDS VERIFICATION: the org's monthly Actions usage lists practical-works-factory and frontdesk separately.

REVIEW VERDICT: changes-requested
REVIEWED DIFF: base=main files=5 lines=116
FINDING: The current FACT-1910 card requires factory/frontdesk caller changes and workflow_dispatch verification, but this PR changes only PracticalWorks/.github; re-scope the card or include/release the missing caller outcome -> changes-requested
FINDING: The body describes tagging v1.2.0 after merge but does not identify how the caller pin bump is released; add the exact pre-merge checklist if this is a prerequisite, or split/re-scope the outcome -> changes-requested
UNVERIFIED: actionlint claim could not run because actionlint is not installed in this review workspace; CI did not run actionlint.

@practical-bot

Copy link
Copy Markdown

Supplemental review evidence for FACT-1910: the native Talos review on head e82363220d431dadf866d8a6d2d32b9b6db3fc35 requested changes. The shared-workflow tests pass (node --test scripts/*.test.mjs: 27/27), but the current card also requires caller changes in practical-works-factory and frontdesk, plus manual verification of all four factory deploy workflows; this PR changes only PracticalWorks/.github. The PR remains open and requires re-scope or the missing caller outcome before approval.

@practical-bot practical-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

The PR body now addresses the prior body-only findings. It links factory#1266 and frontdesk#565 as the caller PRs, puts the exact gh api ... refs/tags/v1.2.0 ... command under an unchecked ## After merge item, and explicitly records the FACT-1052 workflow_dispatch criterion as outside these three PRs and flagged for a scope decision. I therefore reviewed this head against the clarified three-PR release shape rather than treating the caller work as missing from this shared-workflow PR.

Claim ledger

  • “node --test scripts/*.test.mjs: 27 pass, 0 fail.” PASS — node --test scripts/*.test.mjs → 27 tests, 27 pass, 0 fail.
  • “rewriting the deploy job's environment: made it fail 1 of 4.” PASS — replacing name: ${{ inputs.environment }} with name: broken produced 1 failing and 3 passing tests.
  • “with environment empty ... no environment” and “with environment: fact-1910-probe ... sub=...:environment:fact-1910-probe.” UNVERIFIED — the cited probe run is on the earlier d912a381 head and the probe was deleted; this is historical evidence not reproducible from the current diff, not a current-head defect.
  • “GET /repos/PracticalWorks/.github/deployments returned 0 afterwards.” PASS — gh api repos/PracticalWorks/.github/deployments --jq 'length' → 0.
  • “YAML parses. actionlint reports only ... warnings.” UNVERIFIED — actionlint is not installed in this review workspace. The current PR checks ran guard-tests and guard / check successfully on this exact head, but not actionlint.
  • “The README documents the new inputs and why environment exists.” PASS — README contains the environment, deployment, and cache documentation, examples, and the OIDC subject explanation.

The implementation matches the clarified release shape: the shared workflow runs its deploy job in the requested caller environment, makes deployment-record creation explicit, the setup action's cache is opt-out while preserving the existing default, the Infisical action is commit-pinned, and both fallback refs advance to v1.2.0. The workflow tests cover these contracts and pass; the intentional environment mutation proves the new guard is effective.

The PR checks on this exact head e82363220d431dadf866d8a6d2d32b9b6db3fc35 are green (guard-tests, guard / check), and their steps show the test script and PR-body/guardrail checks actually ran.

Verification owed after merge

NEEDS VERIFICATION: the merge commit is tagged v1.2.0, and the latest practical-works-factory and PracticalWorks/frontdesk deploy runs source coolify-deploy.yml from PracticalWorks/.github at that tag and are green.
NEEDS VERIFICATION: gh workflow run is accepted and completes for auto-agent, brain-door, bridge, and plane-bridge, and the hand-run restarts the service with the newly added Infisical value without launchctl or SSH.
NEEDS VERIFICATION: the org's monthly Actions usage lists practical-works-factory and frontdesk separately.

REVIEW VERDICT: approve
REVIEWED DIFF: base=main files=5 lines=116

@practical-bot
practical-bot merged commit 57b82b5 into main Nov 17, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge:queued Hand this PR to the factory merge queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants